package com.lawyer.repository;


import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
import org.springframework.transaction.annotation.Transactional;

import com.lawyer.entity.RegimentalMember;
import java.lang.String;


@RepositoryRestResource(exported = false)
public interface RegimentalMemberRepository extends PagingAndSortingRepository<RegimentalMember, String> , JpaSpecificationExecutor<RegimentalMember> {
	
	@Override
	public List<RegimentalMember> findAll();
	
	

	@Transactional
	@Modifying(clearAutomatically = true)
	@Query(value = "update RegimentalMember r set r.starLevel = ?1 where r.id = ?2")
	int changStarLevel(Integer starLevel, String id);
	
	
	
	RegimentalMember findByMemberId(String memberId);
	
	
}
